﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Magenic.CodeMastery.SharePoint.PMO;


namespace Magenic.CodeMastery.SharePoint.PMO
{
    public partial class SemiGannt : System.Web.UI.UserControl
    {
        private int monthsToRender = 13;

        private Exception showEx = null;

        protected void Page_Load(object sender, EventArgs e) { }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                GraphComposer graph = new GraphComposer(DateTime.Today, monthsToRender);
                StringBuilder markup = new StringBuilder("<p>Custom Text</p>");
                markup.Append(graph.Render());

                EnsureChildControls();
                output.Text = markup.ToString();
            }
            catch (Exception ex)
            {
                showEx = ex;
            }
        }
    }
}